package cn.kgc.hotel.dao;

import cn.kgc.hotel.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Time;
import java.util.Date;
import java.util.List;

@Mapper
public interface RoomMapper {
    //按入住日期和关键字，查询所有可预订房型信息
    List<RoomType> searchRoomType(@Param("dateList") String[] dateList, @Param("keyWord") String keyWord);

    //按房型ID和入住日期查询房型信息
    RoomType searchRoomTypeById(@Param("typeId") Integer typeId, @Param("dateList") String[] dateList);

    //按房型ID和入住日期查询空房间
    List<Room> searchRooms(@Param("typeId") Integer typeId, @Param("dateList") String[] dateList);

    //房间预订,房间订单表room_reserve insert
    //取消房间预订,房间订单表room_reserve insert
    int addRoomReserve(@Param("roomReserve") RoomReserve roomReserve);

    //房间预订，房间日期状态表 room_date insert
    int addRoomDate(@Param("roomDateList") List<RoomDate> roomDateList);

    //房间预订，房间住客表 room_customer insert
    int addRoomCustomer(@Param("roomCustomerList") List<RoomCustomer> roomCustomerList);

    //房间预订，住客表 customer insert
    int addCustomer(@Param("customerList") List<Customer> customerList);

    //查询房间预订
    List<RoomReserve> searchRoomReserve(@Param("userId") int userId);

    /*1、修改房间预订，能修改订单备注信息和住客信息，房间号和入住时间（开始和结束时间）不能改
    2、修改房间预订,房间订单表room_reserve和预订一样执行insert而非update，目的是保留每次修改的数据，而非直接覆盖。
   3、修改房间预订，住客表 customer update*/
    int updateCustomer(@Param("customerList") List<Customer> customerList);

    //取消房间预订，房间日期状态表 room_date update
    int deleteRoomDate(@Param("roomReserve") RoomReserve roomReserve);




}
